# $Id: PKGBUILD 81779 2012-12-29 07:29:09Z svenstaro $
# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: Lone_Wolf <lonewolf@xs4all.nl> 
# Contributor: sausageandeggs <s_stoakley at hotmail.co.uk>

pkgname=singularity
pkgver=0.30c
pkgrel=5
pkgdesc="Strategy game - simulation of true AI"
arch=('any')
url="http://emhsoft.com/singularity/index.html"
license=('GPL2' 'custom')
depends=('python2' 'python2-pygame' 'sdl_image' 'sdl_mixer' 'python2-numpy')
source=("http://endgame-singularity.googlecode.com/files/$pkgname-$pkgver-src.tar.gz" \
        "http://endgame-singularity.googlecode.com/files/endgame-$pkgname-music-006.zip" \
        "singularity"
        "singularity.desktop")
md5sums=('ea4e7d28dd19c33585691ee608672a63'
         'f16d550add4df9c41d4fd68d8ebff40c'
         'fe74e41d2d35dd1907342dea8b078651'
         'c0f49fb6d31a2cf4c0b80393df2aad16')

build() {
  cd "$srcdir/$pkgname-$pkgver"
}

package() {
  cd "$srcdir/$pkgname-$pkgver"

  # install game
  install -Dm644 singularity.py $pkgdir/usr/share/singularity/singularity.py
  cp -R code data "$srcdir/endgame-$pkgname-music-006/music" "$pkgdir/usr/share/$pkgname"
  sed -i 's|/usr/bin/env python|/usr/bin/env python2|g' "$pkgdir/usr/share/$pkgname/code/singularity.py"

  # install shell script
  install -Dm755 "$srcdir/singularity" "$pkgdir/usr/bin/singularity"

  # desktop file
  install -Dm644 "$srcdir/singularity.desktop" "$pkgdir/usr/share/applications/singularity.desktop"

  # license: code is GPL2, but data & music fall under other licenses
  install -Dm644 README.txt "$pkgdir/usr/share/doc/$pkgname/README.txt"
  install -d "$pkgdir/usr/share/licenses/$pkgname/"
  cd "$pkgdir/usr/share/licenses/$pkgname/"
  ln -s ../../doc/$pkgname/README.txt .
}
# vim: sw=2:ts=2 et:
